package test1.practice;

import java.util.Random;

public class IdentifyingCode {
    public static void main(String[] args) {
       identifycode();
    }
        private static int identifycode(){
        char[] chs = new char[52];
        for (int i = 0; i < chs.length; i++) {
            if (i <= 25) {
                //小写字母
                chs[i] = (char) (97 + i);
            } else {
                //当i>26时,添加大写字母
                chs[i] = (char) (65 + i - 26);
            }
        }
       /* for (int i = 0; i < chs.length; i++) {
            System.out.print(chs[i] + " ");
        }*/
        String result="";
        Random r = new Random();
        for (int i = 0; i < 4; i++) {
            int randomIndex = r.nextInt(chs.length);
            result=result+chs[randomIndex];
        }
       //System.out.print(result);
    int number=r.nextInt(10);
        result=result+number;
        System.out.println(result);
        return 0;
    }
}
